﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


using DotNet.Business;
using DotNet.Model;
using DotNet.Common;
using System.Text;
using System.Collections.Generic;
public partial class Admin_mainlogin : System.Web.UI.Page
{
    v_powerInfoBll vBll = new v_powerInfoBll();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
                if (Request.QueryString["action"]!=null)
                {
                    string name = CommUtil.SafeFilter(Request.Form["adminUser"].ToString(), "_");
                    string pwd = CommUtil.SafeFilter(Request.Form["adminPwd"].ToString(), "_");
                    if (vBll.Exists(name, CommUtil.DotEnCrypt(pwd, 24)))
                    {
                        DotCookie.Add("adminUser", name,60);
                        DotCookie.Add("adminPwd", CommUtil.DotEnCrypt(pwd, 24), 60);
                        Response.Redirect("DotNetMain.aspx");
                        //JsUtil.ShowMsg("登陆成功!!!", "DotNetMain.aspx");
                    }
                    else
                    {
                        JsUtil.ShowMsg("帐号密码错误!", "?");
                    }
                }
        }
    }
}
